package br.net.woodstock.tickettoride.struts2.web.security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import br.net.woodstock.tickettoride.orm.User;

public class LogonValidator implements br.net.woodstock.rockframework.web.struts2.security.LogonValidator {

	@Override
	public boolean isLogged(final HttpServletRequest request) {
		HttpSession session = request.getSession();
		if (session.getAttribute(Constants.USER_ATTRIBUTE) != null) {
			Object o = session.getAttribute(Constants.USER_ATTRIBUTE);
			if (o instanceof User) {
				return true;
			}
		}
		return false;
	}
}
